<?php


namespace App\Http\Controllers\Api;


use App\Services\BidGoodsService;
use Illuminate\Http\Request;

class BidGoodsController extends BaseController
{

    /**
     * @api {post} api/bid/store 创建
     *
     * @param Request $request
     * @param BidGoodsService $service
     * @return mixed
     * @throws \Throwable
     */
    public function store(Request $request, BidGoodsService $service) {
        return $service->store($request->input(), true);
    }

    /**
     * @api {get} api/bid/paginate 分页
     *
     * @param Request $request
     * @param BidGoodsService $service
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
     */
    public function index(Request $request, BidGoodsService $service) {
        return $service->index($request->query());
    }

    /**
     * @api {get} api/bid/paginate 分页
     *
     * @param Request $request
     * @param BidGoodsService $service
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
     */
    public function summary(Request $request, BidGoodsService $service) {
        return $service->summary($request->query());
    }

    /**
     * @api {get} api/bid/paginate 分页
     *
     * @param Request $request
     * @param BidGoodsService $service
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
     */
    public function summaryUser(Request $request, BidGoodsService $service) {
        return $service->summaryUser($request->query());
    }
}
